﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using DemoLib.Service.Services;

namespace DemoService.SelfHost
{
    class Program
    {
        static void Main(string[] args)
        {
            #region note for port sharing service
            //type services.msc and set "NetTcpPortSharing" start type to manual
            // start service 
            //net start NetTcpPortSharing
            // add SID in to SMSvcHost.exe.config (C:\Windows\Microsoft.NET\Framework\v4.0.30319) or task mgr (services)-> NetTcpPortSharing -> go to process -> go to file location 
            // get SID wmic useraccount get name,sid
            #endregion

            var authServiceHost = new ServiceHost(typeof(AuthoService));
            authServiceHost.Open();

            var userServiceHost = new ServiceHost(typeof(UserService));
            userServiceHost.Open();

            var emailServiceHost = new ServiceHost(typeof(EmailService));
            emailServiceHost.Open();

            Console.WriteLine("Press any key to exit...");
            Console.ReadLine();
            Console.WriteLine("Closing...");
            authServiceHost.Close();
            
            userServiceHost.Close();

            emailServiceHost.Close();
            
        }
    }
}
